package com.imc.api.banner;

import com.alibaba.fastjson.JSONObject;
import com.imc.platform.base.banner.pojo.BannerItem;
import com.imc.platform.base.banner.service.IBannerService;
import com.twp.common.tuple.ResultDTO;
import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.ui.Model;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.ResponseBody;

import java.util.List;
import java.util.Map;

/**
 * 方法描述:小程序Banner的接口
 * SJC 2018-9-10 10:26:57
 */
@Slf4j
@Controller
public class BannerApiController {


    @Autowired
    IBannerService iBannerService;

    /**
     * 方法描述:根据类型返回banner详情
     * SJC 2018-8-30 20:15:29
     */
    @RequestMapping("/api/public/banner/queryBannerInfo")
    @ResponseBody
    public ResultDTO queryBannerInfo(@RequestParam String bannerType) throws Exception {
        List <Map <String, Object>> retData = iBannerService.queryBannerInfo(bannerType);
        ResultDTO obj = ResultDTO.builder().data(retData).build();
        return obj;
    }
}
